<?php 
require_once('controller/auth.php');
include_once('controller/inc/config.inc');
//Start session
session_start();
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html class=" js cssanimations csstransitions" lang="en"><!--<![endif]--><head><script src="files/user_timeline.json" async=""></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=100%; initial-scale=1; maximum-scale=1; minimum-scale=1; user-scalable=no;">
    <link rel="icon" href="" type="image/png">
    <link rel="shortcut icon" href="" type="image/png">
    <title>Home Page</title>
    <link href="files/bootstrap.css" type="text/css" rel="stylesheet">
    <link href="files/style.css" type="text/css" rel="stylesheet">
    <link href="files/prettyPhoto.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="files/style_common.css">
    <link rel="stylesheet" type="text/css" href="files/style5.css">
    <script type="text/javascript" src="files/jquery.min.js"></script>
    <script type="text/javascript" src="files/jquery_006.js"></script>
    <script type="text/javascript" src="files/bootstrap.js"></script>
    <script type="text/javascript" src="files/jquery_007.js"></script>
    <script type="text/javascript" src="files/jquery_005.js"></script>
    <script type="text/javascript" src="files/superfish.js"></script>
    <script type="text/javascript" src="files/hoverIntent.js"></script>
    <script type="text/javascript" src="files/jquery_003.js"></script>
    <script type="text/javascript" src="files/jquery.js"></script>
    <script type="text/javascript" src="files/save.js"></script>
    
    
    <script type="text/javascript" src="files/jquery_004.js"></script>
    <script type="text/javascript" src="files/jquery_002.js"></script>
    <script type="text/javascript" src="files/jquery_010.js"></script>
    <script type="text/javascript" src="files/smoothscroll.js"></script>
    <script type="text/javascript" src="files/jquery_008.js"></script>
    <script type="text/javascript" src="files/main.js"></script>
    <script type="text/javascript" src="files/ajax-mail.js"></script>
    <script type="text/javascript" src="files/accordion.js"></script>
    <script type="text/javascript" src="files/jquery_009.js"></script>
    <script type="text/javascript" src="files/modernizr.js"></script>



    <!--Le Google Fonts-->
    <link href="files/css.css" rel="stylesheet" type="text/css">

</head>

<body>

<header id="header">
    <div class="container">
        <div class="row">
            <div class="span3 logo">
                <a class="container breadcrumbs" href="#"><h1>AHC &amp; <span style="color:#00AEEF !important">Jotun</span><h1></a>
            </div>
            <nav id="menu" class="pull-right">
                <ul class="sf-js-enabled sf-shadow">
                    <li ><a class="current" href="main.php">Home</a></li>
                    <li><a href="#">Invoice</a></li>
                       
                    <li><a href="#">About Us</a></li>
                    <li><a href="controller/logout.php">Logout (<?php echo $_SESSION['SESS_NAME'] ?>)</a></li>
                </ul>
            </nav>
        </div>

    </div>
</header>


<!--breadcrumbs 
<div class="container breadcrumbs">
    <h1>Contact Us</h1>
    <div>You are here: &nbsp;&nbsp;<a href="#">Home</a> &nbsp;/&nbsp; Contact</div>
</div>
-->



<!--container-->

<section id="container">
    <div class="container">
        <div class="row">
        
        
        
        
   <div id="tab" class="btn-group " data-toggle="buttons-radio" style="padding-left:30px;">
  <a href="#addpc" class="btn active btn-info" data-toggle="tab">Add Prjoduct Category</a>
  <a href="#addp" class="btn btn-info" data-toggle="tab">Add Product</a>
  <a href="#updatepc" class="btn btn-info" data-toggle="tab">Update Product Category</a>
  <a href="#updatep" class="btn btn-info"  data-toggle="tab">Update Product</a>
  
</div>     
        
        
 





        
        
         <div class="span9 tab-content">
	<!--Content-->
<div id='saveResult'></div>

<div class="form-horizontal tab-pane active" id="addpc">
  <fieldset>
    <div id="legend">
      <legend class="">Add New Product Category</legend>
    </div>
    <div class="control-group">
      <!-- Username -->
      <label class="control-label">Category Name</label>
      <div class="controls">
        <input type="text" id='pcat' name="pcat" placeholder="" class="input-xlarge">
        <p class="help-block">Enter a short name for Product Category</p>
      </div>
    </div>
    
    
    
    <div class="controls-group">
    <label class="control-label">Category Description</label>
      <div class="controls">
          <textarea id="pcdesc" name="pcdesc" class="span4" placeholder="Category Description" rows="6"></textarea>
      </div>
    </div>
    
    <input type='hidden' value ='addcat' id='frmtype' name='frmtype'>
    <input type='hidden' value ='<?php echo $today = date("Y-m-d"); ?>' id='added_on'>
    <input type='hidden' value ='<?php echo $_SESSION['SESS_MEMBER_ID']; ?>' id='added_by'>
    <div class="clearfix"></div><br/>
    <div class="control-group">
      <!-- Button -->
      <div class="controls">
        <button class="btn btn-success subbtn" id='subbtn'>Create Category</button>
      </div>
    </div>
  </fieldset>
</div>





<div class="form-horizontal tab-pane" id="addp">
  <fieldset>
    <div id="legend">
      <legend class="">Add New Product </legend>
    </div>
    
    <div class="control-group">
      <label class="control-label">Category</label>
      <div class="controls">
        <select name="product_cat" id="product_cat">
        
        
        <?php
        $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
			if(!$link) {
				die('Failed to connect to server: ' . mysql_error());
			}
			
			//Select database
			$db = mysql_select_db(DB_DATABASE);
			if(!$db) {
				die("Unable to select database");
			}
        	$sql = "Select * from product_cat";
        	$res = mysql_query($sql) or die("Err : ".mysql_error());
        	$option = "";
        	while($row=mysql_fetch_array($res)){
        	echo "<option value=";
        	echo $row[0].">";
        	echo $row['name']."</option>";
        	}
        	//echo $option;
        ?>
        	
        </select>
        <p class="help-block">Select a valid product category</p>
      </div>
    </div>
    <div class="control-group">
      <!-- Username -->
      <label class="control-label">Product Name</label>
      <div class="controls">
        <input type="text" id='pname' name="pname" placeholder="Enter a short name for your Product" class="input-xlarge">
        <!-- <p class="help-block">Enter a short name for your Product</p> -->
      </div>
    </div>

	
	<div class="control-group">
      <!-- Username -->
      <label class="control-label">Quantity</label>
      <div class="controls">
        <input type="text" id='pquantity' name="pquantity" placeholder="How many ? ex(34 packs)" class="input-xlarge">
        <!-- <p class="help-block">Enter a short name for your Product</p> -->
      </div>
    </div>
	

    <div class="control-group">
      <!-- E-mail -->
      <label class="control-label">Unit of Measurement</label>
      <div class="controls">
        <input type="text" id='uom' name="uom" placeholder='Provide Valid Unit of Measurement (e.g 1/2")' class="input-xlarge">
        <!-- <p class="help-block">Provide Valid Unit of Measurement (e.g 1/2")</p> -->
      </div>
    </div>

    
    <div class="control-group">
      <!-- Password-->
      <label class="control-label">Size</label>
      <div class="controls">
        <input type="text" id='psize' name="psize"  placeholder="Product Size (e.g. 20X20 m)" class="input-xlarge">
        <!-- <p class="help-block">Product Size (e.g. 20X20 m)</p> -->
      </div>
    </div>
    
    
    
   <div class="control-group">
      <label class="control-label">Currency</label>
      <div class="controls">
        <select name="currency" id="currency">
        	<option value="0">Afghanis (AF)</option>
        	<option value="1">Dollars ($)</option>
        	
                	
        </select>
      </div>
    </div>
    
    
     <div class="control-group">
     
      <label class="control-label">Initial Price</label>
      <div class="controls">
        <input type="text" id='iprice'  name = 'iprice' placeholder='Initial price of product for the customer' class="input-xlarge">
        <!--  <p class="help-block">Initial price of product for the customer.</p> -->
      </div>
    </div>
    
     <div class="control-group">
     
      <label class="control-label">Final Price</label>
      <div class="controls">
        <input type="text" id='fprice'  name = 'fprice' placeholder='Final price of product for the customer' class="input-xlarge">
        <!--  <p class="help-block">Final price of product for the customer.</p> -->
      </div>
    </div>
    
    
    <div class="controls-group">
    <label class="control-label">Project Description</label>
      <div class="controls">
          <textarea id="pdesc" name="pdesc" class="span6" placeholder="Project Description" rows="5"></textarea>
      </div>
    </div>
    
    
    
    
    <input type='hidden' value ='addproduct' id='frmtype' name='frmtype'>
    <input type='hidden' value ='<?php echo $today = date("Y-m-d"); ?>' id='added_on2' name='added_on2'>
    <input type='hidden' value ='<?php echo $_SESSION['SESS_MEMBER_ID']; ?>' id='added_by2' name='added_by2'>
    <div class="clearfix"></div><br/>
    <div class="control-group">
      <!-- Button -->
      <div class="controls">
        <button class="btn btn-success subbtn2" id='subbtn2'>Add Product</button>
      </div>
    </div>
  </fieldset>
</div>


	


	<!--/Content-->
	
    </div>
        
        
       
       
       
       
       
       
       
       
       
       
        
        
        
        
        
        
        <!-- 
            <section id="page-sidebar" class="alignrleft span9">
                <article>
                    <h3>Contact us</h3>
                    <p>
                        Etiam imperdiet, ante at porttitor rutrum, felis
 nisi pellentesque enim, vel viverra quam orci eu massa. 
                        Integer commodo, velit eget dapibus tincidunt, 
mauris ligula porttitor sapien, eget rhoncus dolor mi eu velit. 
                        Fusce mattis dui eu velit fringilla viverra. 
Aliquam non nibh non orci imperdiet venenatis. 
                        Quisque varius orci a lacus adipiscing id tempus
 elit pharetra. 
                    </p>
                </article>  

                <hr>
                
                <form name="contact" method="post" action="contact.html" class="af-form" id="af-form">
                    <div class="af-outer af-required">
                        <div class="af-inner">
                            <label for="name" id="name_label">Your Name:</label>
                            <input style="background-color: rgb(255, 255, 255);" name="name" id="name" size="30" class="text-input input-xlarge" type="text">
                            <label style="display: none;" class="error" for="name" id="name_error">Name is required.</label>
                        </div>
                    </div>
                    <div class="af-outer af-required">
                        <div class="af-inner">
                            <label for="email" id="email_label">Your Email:</label>
                            <input style="background-color: rgb(255, 255, 255);" name="email" id="email" size="30" class="text-input input-xlarge" type="text">
                            <label style="display: none;" class="error" for="email" id="email_error">Email is required.</label>
                        </div>
                    </div>
                    <div class="af-outer af-required">
                        <div class="af-inner">
                            <label for="input-message" id="message_label">Your Message:</label>
                            <textarea style="background-color: rgb(255, 255, 255);" name="message" id="input-message" cols="30" class="text-input"></textarea>
                            <label style="display: none;" class="error" for="input-message" id="message_error">Message is required.</label>
                        </div>
                    </div>
                    <div class="af-outer af-required">
                        <div class="af-inner">
                            <input name="submit" class="form-button btn" id="submit_btn" value="Send Message!" type="submit">
                        </div>
                    </div>
                </form>
            </section>
           
           <!--
           
            <aside id="sidebar" class="alignright span3">
                <section>
                    <div class="title-divider">
                        <div class="divider-arrow"></div>                               
                        <h4>Address</h4>             
                    </div>
                    <address>
                        <strong>Organization Name</strong><br>
                        Street Name 432/2<br>
                        London, 90210<br>
                        <abbr title="Phone">P:</abbr> (123) 456-7890
                      </address>
                    <address>
                        <strong>Full Name</strong><br>
                        <a href="mailto:#">info@email.com</a>
                    </address>
                </section>
                
                
                
                
                <!--twitter 
                <section id="twitter-sidebar">
                    <div class="title-divider">
                        <div class="divider-arrow"></div>                               
                        <h4>Twitter</h4>             
                    </div>
                    <div class="twitter"><p class="loading">loading tweets...</p></div>
                    <script type="text/javascript">
                        $(document).ready(function(){
                            //twitter
                            $(".twitter").tweet({
                                join_text: "auto",
                                username: "twitter",
                                avatar_size:40,
                                count: 2,
                                auto_join_text_default: "we said,",
                                auto_join_text_ed: "we",
                                auto_join_text_ing: "we were",
                                auto_join_text_reply: "we replied",
                                auto_join_text_url: "we were checking out",
                                loading_text: "loading tweets..."
                            });
                        });
                    </script>
                </section>
                
            </aside>
            -->
        </div>
    </div>    
</section>

<!--footer
<footer id="footer">
    <div class="container">
        <div class="row">
            <div class="span3">
                <h3>Text Widget</h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut in lacus rhoncus elit egestas luctus. Nullam at lectus augue.</p>
                <p>Ut tristique consectetur elit, sed tincidunt elit 
iaculis in. In hac habitasse platea dictumst. Curabitur condimentum 
justo sed urna porttitor aliquam.</p>
            </div>
            <div class="span3">
                <h3>Flickr Photos</h3>
                <ul class="flickr clearfix"><li><a rel="prettyPhoto[flickr]" href="http://farm8.staticflickr.com/7381/9017742627_d5af918c8c.jpg" title="Live"><img src="files/9017742627_d5af918c8c_s.jpg" alt="Live"></a></li><li><a rel="prettyPhoto[flickr]" href="http://farm3.staticflickr.com/2845/8975967779_e16d3e9c1b.jpg" title="Tempest"><img src="files/8975967779_e16d3e9c1b_s.jpg" alt="Tempest"></a></li><li><a rel="prettyPhoto[flickr]" href="http://farm4.staticflickr.com/3755/8934979112_15f1165534.jpg" title="Parliament - Országház"><img src="files/8934979112_15f1165534_s.jpg" alt="Parliament - Országház"></a></li><li><a rel="prettyPhoto[flickr]" href="http://farm3.staticflickr.com/2827/8753201043_a9f7617458.jpg" title="At peace"><img src="files/8753201043_a9f7617458_s.jpg" alt="At peace"></a></li><li><a rel="prettyPhoto[flickr]" href="http://farm8.staticflickr.com/7281/8743851283_2da79e3b76.jpg" title="Madrid"><img src="files/8743851283_2da79e3b76_s.jpg" alt="Madrid"></a></li><li><a rel="prettyPhoto[flickr]" href="http://farm8.staticflickr.com/7428/8723056327_03fa508a52.jpg" title="For you and for me"><img src="files/8723056327_03fa508a52_s.jpg" alt="For you and for me"></a></li></ul>
            </div>
            <div class="span3">
                <h3>Contact Form</h3>
                <form id="contact" class="form-horizontal" method="post">
                    <div class="control-group">
                        <label class="control-label" for="inputName">Name</label>
                        <div class="controls">
                            <input id="inputName" placeholder="Name" name="inputName" type="text">
                            <label style="display: none;" class="ferror" for="inputName" id="fname_error">Name is required.</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="inputEmail">Email</label>
                        <div class="controls">
                            <input id="inputEmail" placeholder="Email" name="inputEmail" type="text">
                            <label style="display: none;" class="ferror" for="inputEmail" id="femail_error">Email is required.</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="inputMessage"></label>
                        <div class="controls">
                            <textarea rows="3" id="inputMessage" name="inputMessage"></textarea>
                            <label style="display: none;" class="ferror" for="inputMessage" id="fmessage_error">Message is required.</label>
                        </div>
                    </div>
                    <div class="submit-div">
                        <input class="btn pull-right footer-button" value="SUBMIT!" type="submit">
                    </div>
                </form>
            </div>
            <div class="span3">
                <h3>Address</h3>
                <address>
                    Companyname inc.<br>
                    London,  Baker Street, 90210<br>
                    <i class="myicon-phone"></i>(123) 456-7890<br>
                    <i class="myicon-mail"></i>info@dxthemes.com
                </address>
                Ut eu nulla eget massa blandit eleifend vel sedis lacus.
 Sed at viverra nulla. Fusce vel adipisci odio. Phasellus commodo, 
mauris eget pharetra scelerisque, est justo lacinia tortor.
            </div>
        </div>
    </div>
</footer>

footer menu-->
<section id="footer-menu">
    <div class="container">
        <div class="row">
            <div class="span8 hidden-phone">
                <ul>
                    <li><a href="#">Home</a></li>
                    <li><a href="#">Invoice</a></li>
                    <li><a href="#">About</a></li>
                </ul>
            </div>
            <p class="span4"><span class="pull-right">Powered by <a href="http://www.w3scripts.net"><span style="color:#00AEEF !important">W3SCRPTS</span>.net</a></span></p>
        </div>
    </div>
</section>

<a style="display: none;" href="#" id="toTop"><span id="toTopHover"></span>To Top</a></body></html>